package it.unibo.contact.EnvSystem;

import it.unibo.is.interfaces.IMessage;
import it.unibo.is.interfaces.platforms.IAcquireOneReply;

public class Process1 extends Process1Support {

	public Process1() throws Exception 
	{
		super();
		value = "valueProcess1";
	}
	
	@Override
	public void doJob() throws Exception 
	{
		sleep(1000);
		MyClass object = new MyClass(42);
//		object.setDato1(42);
		object.getList().add("Ale");
		object.getList().add("Ricky");
		
		
//		hl_process_ask_observeData_environment(key);
		
		showMsg("putData: [" + key + ":" + value + "]");
		hl_process_ask_putData_environment(key, object);
		
//		IMessage m = acquire("dataChanged");
//		showMsg("Event: " + m.msgContent());
		
//		showMsg("Going to sleep...");
//		sleep(5000);
//		
		showMsg("Other data...");
		String otherKey = "otherKey";
		String newValue = "OtherValue";
		hl_process_ask_putData_environment(otherKey, newValue);
		
		showMsg("Other data...");
		otherKey = "otherKey2";
		int otherValue = 46;
		hl_process_ask_putData_environment(otherKey, otherValue);
//		
//		key = "newKey";
//		value = "newNewValue";
//		showMsg("putData: [" + key + ":" + value + "]");
//		hl_process_ask_putData_environment(key+":"+value);
		
	}

}
